package testMaker;

import java.io.File;
import java.io.IOException;

public class TestMakerDR {

public static void main(String[] args) throws IOException {
		
	String[] instancefiles = {"instances/dim10", "instances/dim11", "instances/dim12", "instances/dim13", "instances/dim14", "instances/dim15"};
	
	String[] uncertsetfiles = {"set/dim10", "set/dim11", "set/dim12", "set/dim13", "set/dim14", "set/dim15"};
	
	String[][] outfiles = new String[100][4];
	File[] intances;
	File[] us;
	File usi;
	Process process;
	double[] gam = {0.25, 0.5, 0.75};
	int[] vk = new int[4];
	int[] gamma = {5,5,6,6,7,7,8,8};
	
	for(int dim = 0; dim < 2; dim++){
		intances = new File(instancefiles[dim]).listFiles();
		us = new File(uncertsetfiles[dim]).listFiles();
		vk[0] = 1;

		
		for(int algo = 0; algo < 4; algo++){
			outfiles[dim][algo] = "DRResultsDIM="+Integer.toString(dim) +"ALGO="+Integer.toString(algo) +".txt";
			
			for(int k = 0; k < 1; k++){
				for(File di : intances){
					for(int j = 0; j < 6; j++){
						usi = us[j];
						String exp = "java -jar WAREHOUSEDR.jar "+
								Integer.toString(vk[k])+ " "+
								Integer.toString(algo)+ " "+
								Integer.toString(dim + 10) + " "+
								Integer.toString(gamma[dim]) + " "+
								di.toString() + " " +
								usi.toString() + " " +
								outfiles[dim][algo].toString()+ " " +
								Integer.toString(0);
							
							
						System.out.println(exp);
						process = Runtime.getRuntime().exec(exp);
						try {
							process.waitFor();
						} catch (InterruptedException e) {
							System.out.println("*****Problems with the Waiting*****");
						System.out.println("*****End of the solution!*****");
					}
				}
			}
		}
	}
		
	}

}

}